<template>
  <keep-alive include="markingList">
    <component
      :is="componentName"
      :answer-id="answerId"
      :obj="obj"
      @change="changeComponent"
    />
  </keep-alive>
</template>

<script>
import markingList from "./list";
import markingDetail from "./detail";
export default {
  components: {
    markingList,
    markingDetail,
  },
  data() {
    return {
      componentName: "markingList",
      answerId: "",
      obj: {},
    };
  },
  methods: {
    changeComponent({ componentName, answerId, obj }) {
      this.componentName = componentName;
      this.answerId = answerId;
      this.obj = obj;
    },
  },
};
</script>

<style lang="scss" scoped></style>
